package com.jfm.jfmc.core.service.impl;

import com.jfm.jfmc.core.service.ICollectService;
import com.jfm.jfmm.collector.driver.ACollectorDriver;
import com.jfm.jfmm.collector.entity.collect.CheckResult;
import com.jfm.jfmm.collector.entity.collect.CollectParam;
import com.jfm.jfmm.collector.entity.collect.CollectResult;
import com.jfm.jfmm.collector.enums.CollectorProtocol;
import com.jfm.jfmm.collector.enums.ResultType;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

/**
 * @author DYang
 * @since 2024-10-12 23:06
 */
@Slf4j
@Service
public class CollectServiceImpl implements ICollectService {


    @Override
    public CollectResult collectOne(CollectParam param) {
        CollectorProtocol protocol = param.getProtocol();
        ACollectorDriver<?,?> driver = ACollectorDriver.getDriver(protocol);
        return driver.collect(param.getParam());
    }

    @Override
    public void collectOneAsync(CollectParam param) {

    }
}
